Organization: A poorly-installed InterNetNews site
Message-ID: <4ki9jh$a6f@news.voicenet.com>
NNTP-Posting-Host: d02.rsabbs.com
X-Newsreader: SPRY News 3.03 (SPRY, Inc.)
I'm writing a program in 80x50 text mode on an IBM PC. I'm making a BIOS call to set the cursor position--that part seems to work fine.
But when I attempt to write using printf() at that position it printf diagonally across the screen. Very strange. I'm sure it has something to do with the fact that
I'm using double the screen memory and rows, because it printf()'s fine so long as I don't set the cursor past (24,79), the normal screen memory. There is obviously a
sound logical reason for this occurance, but for the life of me I can't understand why. Could someone enlighten me?
This is the code:
------------------------------------
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
unsigned char x=30,y=40;
asm{ mov ax, 1112h // Set character set to 8x8 font
mov bl, 0h // thereby yeilding 80x50.
int 10h //Call interrup 10h, the video BIOS.
}
fclrscr(); //My own function that clears 4000 bytes of VGA mem. Works fine.